/* Copyright 2023 Xilinx Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*     http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef _INCLUDE_CPU_BFP_H_
#define _INCLUDE_CPU_BFP_H_

void CheckInputForBFP(const torch::Tensor& tensor,
                      int64_t bit_width,
                      int64_t block_size);

void CheckInputForBFPV2(const torch::Tensor& tensor,
                        int64_t bit_width,
                        int64_t block_size);

void CheckInputForBFPPrime(const torch::Tensor& tensor,
                           int64_t bit_width,
                           int64_t block_size,
                           int64_t sub_block_size);

void LaunchBFPCPUKernel(const float* input,
                        float* output,
                        int n,
                        int bit_width,
                        int block_size);

void LaunchBFPCPUKernelV2(const float* input,
                          float* output,
                          int n,
                          int bit_width,
                          int block_size);

void BFPPrimeCPUKernel(const float* input,
                       float* output,
                       const int n,
                       const int offset,
                       const int stride,
                       const int bit_width,
                       const int block_size,
                       const int sub_block_size,
                       const int sub_block_shift_bits,
                       const int rounding_mode);

void LaunchBFPPrimeCPUKernel(const float* input,
                             float* output,
                             int n,
                             const int bit_width,
                             const int block_size,
                             const int sub_block_size,
                             const int sub_block_shift_bits,
                             const int rounding_mode);

#endif // _INCLUDE_CPU_BFP_H_
